<?php

/**
 * SrcmtActividadesIcm form base class.
 *
 * @method SrcmtActividadesIcm getObject() Returns the current form's model object
 *
 * @package    srcmt
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseSrcmtActividadesIcmForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'codigo_actividad_icm'  => new sfWidgetFormInputHidden(),
      'codigo_tipo_actividad' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('SrcmtTipoActividad'), 'add_empty' => false)),
      'actividad'             => new sfWidgetFormTextarea(),
      'fecha'                 => new sfWidgetFormDate(),
      'lugar'                 => new sfWidgetFormTextarea(),
      'duracion'              => new sfWidgetFormTextarea(),
      'created_at'            => new sfWidgetFormDateTime(),
      'updated_at'            => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'codigo_actividad_icm'  => new sfValidatorChoice(array('choices' => array($this->getObject()->get('codigo_actividad_icm')), 'empty_value' => $this->getObject()->get('codigo_actividad_icm'), 'required' => false)),
      'codigo_tipo_actividad' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('SrcmtTipoActividad'))),
      'actividad'             => new sfValidatorString(),
      'fecha'                 => new sfValidatorDate(),
      'lugar'                 => new sfValidatorString(),
      'duracion'              => new sfValidatorString(),
      'created_at'            => new sfValidatorDateTime(),
      'updated_at'            => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('srcmt_actividades_icm[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'SrcmtActividadesIcm';
  }

}
